<!DOCTYPE html>
<html lang="en">
<head>
    <title>关键词查询系统</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="/static/css/index.css">
    <script>
        var time = 1,
            keyword_data = undefined,
            keywords = [],
            price_value = 1,
            number_limit = {$number};
    </script>
    <script src="/static/js/base.js"></script>
    <style>
        .keywords-price-content span:nth-child(1){
            display:none;
        }
        .warn{
            margin-top: 45px;
            position: absolute;
            display: none;
            font-size: 15px;
            color: red;
        }
        #price-title{
            width: auto;
        }
        #price-title img{
            width: 115px;
        }
        #price-title div{
            line-height: 20px;
            padding:5px 0;
            font-size: 18px;
            color: #0fa314;
            text-decoration: underline;
        }
        #price-content img{
            width: 115px;
        }
        #price-content div{
            line-height: 20px;
            padding:5px 0;
        }
        #price-content div i{
            width: 120px;
            display: inline-block;
        }
        .cx-title{
            width: 100%;
            height: 35px;
            display: flex;
            justify-items: center;
            align-items: center;
        }
        .cx-title p{
            display: inline-block;
            width:90%;
            height: 30px;
            line-height: 30px;
            text-indent: 0.5em;
            font-size: 18px;
            margin-bottom: 10px;
            font-weight: bold;
        }
        .cx-title a{
            display: inline-block;
            width:10%;
            height: 30px;
            line-height: 30px;
            color:deepskyblue;
            text-align: center;
        }
        .cx-title a ul{
            width: 8.75%;
            margin: 0px;
            padding: 0px;
            list-style: none;
            text-align:right;
            display: none;
            position: absolute;
        }
        .cx-title a ul li{
            width: 100%;
            color: #f1f1f1;
            display: block;
            background-color: rgb(163, 163, 163);
            border-bottom: 1px solid #333;
            text-align: center;
            margin: 0px;
            padding: 0px;
        }
        .msg{
            position: absolute;
            overflow: hidden;
            left: 50%;
            top: 10%;
            width: 900px;
            height: 600px;
            margin-left: -450px;
            border: 1px solid #0fa314;
            border-radius: 15px;
            background-color: #f6f6f6;
            z-index: 1001;
        }
        .msg .title{
            width: 900px;
            height: 50px;
            background-color: #75d6da;
        }
        .msg .title span{
            display:inline-block;
            color: #fff;
            margin-left: 400px;
            margin-right: 330px;
            width: 100px;
            text-align: center;
        }
        .msg .title a{
            display: inline-block;
            width: 30px;
            height: 30px;
            margin: 5px;
            padding:5px;
            background-color: #c70909;
            color: #f1f1f1;
            text-decoration: none;
            text-align: center;
            line-height: 30px;
            font-size: 19px;
        }
        .msg .content{
            width: 900px;   
            height: 550px;
            overflow-x: hidden;
            overflow-y: auto;
        }
        .msg content ul{
            margin: 0px;
            padding: 0px;
            width: 900px;
        }
        .msg .content ul li{
            color: #333;
            width:870px;
            padding:5px 15px;
            list-style: none;
            min-height:30px;
            line-height: 30px;
        }
        .right b a{
            color:#3568f7;
            text-decoration: none;
        }
    </style>
    <script>
        var show_message = 1;
        function message_blick(obj){
            let message = document.getElementById('message');
            if(show_message == 1){
                message.style = 'display:block';
                obj.style = 'background-color: rgb(163, 163, 163);color: #f1f1f1;';
                show_message = 2;
            }else{
                message.style = '';
                obj.style = '';
                show_message = 1;
            }
        }
    </script>
</head>
<body>
    <div id="myModal" class="modal">  
        <div class="modal-content">  
            <span class="close">&times;</span>  
            <img src="/static/images/jiazaizhong.gif">  
        </div>  
    </div>
    <div id="msg" class="msg" style="display: none;">
        <div class="title">
            <span>禁售行业规则</span>
            <a href="javascript:;" onclick="hiddenmsg()">X</a>
        </div>
        <div class="content">
            <ul>
                <li>1、教育培训行业（如：出国留学、人才引进、教育培训、情感咨询等）；</li>
                <li>2、搬家行业行业（如：物流、搬家、快递）；</li>
                <li>3、律师行业行业（如：法律、司法鉴定）；</li>
                <li>4、古董鉴定，拍卖行业（如：拍卖，古董鉴赏）；</li>
                <li>5、医疗医药行业（如：代孕、药品、保健品、医疗器械、化妆品、医疗、医院、体检等）；</li>
                <li>6、游戏行业（如：聊天交友、直播平台、网络游戏、APP下载、视频直播、娱乐等）；</li>
                <li>7、食品行业（如：粮油、蔬果、坚果、肉类、蛋、水产、速食、调味品、茶等饮品、传统滋补品、其他营养品等）；</li>
                <li>8、涉及电商售卖商品行业；</li>
                <li>9、资质代办行业（如：签证、留学、代开发票、注册公司，公司代办等）;</li>
                <li>10、APP推广行业（如：禁止投放所有涉及 App 推广、软件推广、下载等宣传物料）；</li>
                <li>11、大宗品行业（如：原油期货）；</li>
                <li>12、招商加盟行业（如：创业加盟，涉嫌加盟，及投放网站不能出现招商加盟字样及栏目、网络公司（尤其是页面涉及优化，seo，万词霸屏，快速排名此类字眼的））；</li>
                <li>13、养生行业（如：养生馆加盟，药膳养生，中医养生，经络调理）；</li>
                <li>14、公积金类行业（如：公积金代办，公积金提取）；</li>
                <li>15、金融行业（如：银行业、保险业、信托业、证券类、外汇、公正、认证机构、银行、贷款、融资类、彩票类、招标类、纪念币销售）；</li>
                <li>16、学术代写行业（如：论文代写等）；</li>
                <li>17、品牌词（如：有品牌保护的）；</li>
                <li>18、非法行业（如：黄赌毒等涉及违法的，注：包含会所按摩、风水、迷信、证照印刷、刻章、纹身等服务）；</li>
                <li>19、黑社会性质行业（如：私家侦探、婚姻侦探行业、讨债、追债等）；</li>
                <li>20、汽车行业（如：汽车配件，二手车、报废车回收、汽车租赁）；</li>
                <li>21、房地产行业（如：房产中介、房地产、房屋监理、担保类、典当行）；</li>
                <li>22、涉及宗教及政治相关行业；</li>
                <li>23、国家执法部门有关行业（如：财税、警用产品、开锁等）；</li>
            </ul>
        </div>
    </div>
    <div class="content">
        <div class="cx-title">
            <p>关键词查询系统</p>
            <a href="javascript:;" onclick="message_blick(this)">
                {$user.username}
                <ul id="message">  
                    <li onclick="location.href='/index/user/info'">子账号管理</li>
                    <li onclick="location.href='/index/user/password'">修改密码</li>  
                    <li onclick="location.href='/index/out'">注销</li>  
                </ul>  
            </a>
        </div>
        <div class="cx-caption"><b>选择基础配置</b></div>
        <div>
            <ul>
                <li>
                    <div class="left"><span>展示端</span></div>
                    <div class="right radio-group">
                        <input type="radio" id="radio3" name="type" value="1" onchange="price_change();" checked><label for="radio3" id="lr3"></label><a href="javascript:lr(3);">全端</a>
                        <input type="radio" id="radio1" name="type" value="2" onchange="price_change();"><label for="radio1" id="lr1"></label><a href="javascript:lr(1);">PC端</a>
                        <input type="radio" id="radio2" name="type" value="3" onchange="price_change();"><label for="radio2" id="lr2"></label><a href="javascript:lr(2);">移动端</a>
                    </div>
                </li>
                <li>
                    <div class="left">
                        <span>关键词</span>
                    </div>
                    <div class="right keyword">
                        <input type="text" id="keyword" value="{$keyword}" placeholder="关键词查询(如果多个关键词查询用逗号隔开)">
                        <input type="button" value="点击查价" class="kbutton" onclick="select_keyword()">
                        <span id="warn" class="warn">提示：该关键词已经有客户下单</span>
                    </div>
                </li>
                <li style="display: none;">
                    <div class="left" id="keywords-title"></div>
                    <div class="right keywords-content" id="keywords-content"></div>
                </li>
                <li style="display: none;">
                    <div class="left" id="keywords-price-title"></div>
                    <div class="right keywords-price-content" id="keywords-price-content"></div>
                </li>
                <li>
                    <div class="left">购买时长</div>
                    <div class="right end_time" id="end_time_alist">
                        <a id="one_year" href="javascript:;" class="abutton" onclick="end_time(this,1)">1年</a>
                    </div>
                </li>
                <li>
                    <div class="left" id="price-title"></div>
                    <div class="right" id="price-content"></div>
                </li>

                <!-- <li>
                    <div class="left">历史记录:</div>
                    <div class="right price-history" id="price-history"></div>
                </li> -->
                <!-- <li>
                    <div class="left"></div>
                    <div class="right"><button class="submit">下单</button></div>
                </li> -->
                <li>
                    <div class="left">系统提示:</div>
                    <div class="right" style="color: #c70909;"><b>部分关键词为禁开行业。<a href="javascript:;"  onclick="showmsg()">《点击查看》</a></b></div>
                </li>
                <li>
                    <div class="left">导出结果</div>
                    <div class="right"><a href="javascript:;" onclick="getXlsx()">导出</a></div>
                </li>
            </ul>
            <form id="form" action="/index/keyword/order_create" method="post" style="display:none">
                <input type="text" name="keywords" id="form-keywords">
                <input type="text" name="price_type" id="price_type">
            </form>
        </div>
        <div class="cx-footer"></div>
        <div class="cx-bottom">
            <span>价格:<b id="change_total_price">0</b>&nbsp;&nbsp;&nbsp;&nbsp;<b style="font-size: 16px;color: #c70909;">(具体价格因实时查询价格为主)</b></span>
            <a href="javascript:;" onclick="order_create()">下一步</a>
            <!-- <a href="">取消</a> -->
        </div>
    </div>
</body>
<script>
    var is_look = "{$user.is_look_data}";
    document.getElementById('one_year').click();
    var modal = document.getElementById("myModal");  
    var span = document.getElementsByClassName("close")[0];  
    // 当用户点击关闭按钮时，关闭弹框  
    span.onclick = function() {  
      modal.style.display = "none";  
    }
    document.getElementsByClassName('kbutton')[0].click();
    function showmsg(){

    }
    function getXlsx(){
        // 假设您有这些数据
        let data = [];
        data.push(["关键词","全端价格","PC端价格","手机端价格"]); 
        keyword_data.forEach(function(item,index){
            data.push([
                item.keyword,
                item.price,
                item.pc_price,
                item.phone_price
            ]);
        });
        // 调用函数并下载CSV文件  
        const csvContent = arrayToCSV(data); 

        downloadCSV(csvContent, 'output.csv');
    }
    // 将数据转换为CSV字符串 
    function arrayToCSV(data) {  
        console.log(data);
        const str = data.map(
            row => row.join(',')
        ).join('\n');  
        return `data:text/csv;charset=utf-8,${str}`;  
    }  
    // 创建一个下载链接 
    function downloadCSV(csvContent, filename) {  
        const link = document.createElement('a');  
        link.setAttribute('href', csvContent);  
        link.setAttribute('download', filename);  
        document.body.appendChild(link);  
        link.click();  
        document.body.removeChild(link);  
    }
    function showmsg(){
        document.getElementById('msg').style = 'display:block';
    }
    function hiddenmsg(){
        document.getElementById('msg').style = 'display:none';
    }
    {empty name="keyword"}select_keyword();{/empty}
</script>
</html>